# coding=utf-8
from flask import Flask
from flask_sockets import Sockets

from server.base.log4py import logger
from server.base.tools.regexConverter import RegexConverter

app = Flask(__name__)
sockets = Sockets(app)
app.config.from_object('config')
app.secret_key = 'A0Zr98j/3yX R~XHH!jmN]LWX/,?RT'
app.url_map.converters['regex'] = RegexConverter

logger.info("配置文件路径 ====> " + app.config["CONF"])
logger.info("缓存文件路径 ====> " + app.config["CACHEDATA_JSON"])

from server.views import regctrl,clientctrl

# http
app.register_blueprint(regctrl.sv)
app.register_blueprint(clientctrl.sv)

# sockets
sockets.register_blueprint(clientctrl.ws)